3.1.4 \(\int \tan ^4(c+d x) \, dx\) [4]

Optimal. Leaf size=28 \[ x-\frac {\tan (c+d x)}{d}+\frac {\tan ^3(c+d x)}{3 d} \]

[Out]

x-tan(d*x+c)/d+1/3*tan(d*x+c)^3/d

________________________________________________________________________________________

Rubi [A]
time = 0.01, antiderivative size = 28, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.250, Rules used = {3554, 8} \begin {gather*} \frac {\tan ^3(c+d x)}{3 d}-\frac {\tan (c+d x)}{d}+x \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Tan[c + d*x]^4,x]

[Out]

x - Tan[c + d*x]/d + Tan[c + d*x]^3/(3*d)

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 3554

Int[((b_.)*tan[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[b*((b*Tan[c + d*x])^(n - 1)/(d*(n - 1))), x] - Dis
t[b^2, Int[(b*Tan[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n, 1]

Rubi steps

\begin {align*} \int \tan ^4(c+d x) \, dx &=\frac {\tan ^3(c+d x)}{3 d}-\int \tan ^2(c+d x) \, dx\\ &=-\frac {\tan (c+d x)}{d}+\frac {\tan ^3(c+d x)}{3 d}+\int 1 \, dx\\ &=x-\frac {\tan (c+d x)}{d}+\frac {\tan ^3(c+d x)}{3 d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.01, size = 38, normalized size = 1.36 \begin {gather*} \frac {\text {ArcTan}(\tan (c+d x))}{d}-\frac {\tan (c+d x)}{d}+\frac {\tan ^3(c+d x)}{3 d} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Tan[c + d*x]^4,x]

[Out]

ArcTan[Tan[c + d*x]]/d - Tan[c + d*x]/d + Tan[c + d*x]^3/(3*d)

________________________________________________________________________________________

Maple [A]
time = 0.02, size = 31, normalized size = 1.11

method result size
norman \(x -\frac {\tan \left (d x +c \right )}{d}+\frac {\tan ^{3}\left (d x +c \right )}{3 d}\) \(27\)
derivativedivides \(\frac {\frac {\left (\tan ^{3}\left (d x +c \right )\right )}{3}-\tan \left (d x +c \right )+\arctan \left (\tan \left (d x +c \right )\right )}{d}\) \(31\)
default \(\frac {\frac {\left (\tan ^{3}\left (d x +c \right )\right )}{3}-\tan \left (d x +c \right )+\arctan \left (\tan \left (d x +c \right )\right )}{d}\) \(31\)
risch \(x -\frac {4 i \left (3 \,{\mathrm e}^{4 i \left (d x +c \right )}+3 \,{\mathrm e}^{2 i \left (d x +c \right )}+2\right )}{3 d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{3}}\) \(46\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(d*x+c)^4,x,method=_RETURNVERBOSE)

[Out]

1/d*(1/3*tan(d*x+c)^3-tan(d*x+c)+arctan(tan(d*x+c)))

________________________________________________________________________________________

Maxima [A]
time = 0.49, size = 29, normalized size = 1.04 \begin {gather*} \frac {\tan \left (d x + c\right )^{3} + 3 \, d x + 3 \, c - 3 \, \tan \left (d x + c\right )}{3 \, d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)^4,x, algorithm="maxima")

[Out]

1/3*(tan(d*x + c)^3 + 3*d*x + 3*c - 3*tan(d*x + c))/d

________________________________________________________________________________________

Fricas [A]
time = 0.36, size = 26, normalized size = 0.93 \begin {gather*} \frac {\tan \left (d x + c\right )^{3} + 3 \, d x - 3 \, \tan \left (d x + c\right )}{3 \, d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)^4,x, algorithm="fricas")

[Out]

1/3*(tan(d*x + c)^3 + 3*d*x - 3*tan(d*x + c))/d

________________________________________________________________________________________

Sympy [A]
time = 0.08, size = 27, normalized size = 0.96 \begin {gather*} \begin {cases} x + \frac {\tan ^{3}{\left (c + d x \right )}}{3 d} - \frac {\tan {\left (c + d x \right )}}{d} & \text {for}\: d \neq 0 \\x \tan ^{4}{\left (c \right )} & \text {otherwise} \end {cases} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)**4,x)

[Out]

Piecewise((x + tan(c + d*x)**3/(3*d) - tan(c + d*x)/d, Ne(d, 0)), (x*tan(c)**4, True))

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 585 vs. \(2 (26) = 52\).
time = 0.96, size = 585, normalized size = 20.89 \begin {gather*} \frac {3 \, \pi + 12 \, d x \tan \left (d x\right )^{3} \tan \left (c\right )^{3} - 3 \, \pi \mathrm {sgn}\left (2 \, \tan \left (d x\right )^{2} \tan \left (c\right ) + 2 \, \tan \left (d x\right ) \tan \left (c\right )^{2} - 2 \, \tan \left (d x\right ) - 2 \, \tan \left (c\right )\right ) \tan \left (d x\right )^{3} \tan \left (c\right )^{3} - 3 \, \pi \tan \left (d x\right )^{3} \tan \left (c\right )^{3} + 6 \, \arctan \left (\frac {\tan \left (d x\right ) \tan \left (c\right ) - 1}{\tan \left (d x\right ) + \tan \left (c\right )}\right ) \tan \left (d x\right )^{3} \tan \left (c\right )^{3} + 6 \, \arctan \left (\frac {\tan \left (d x\right ) + \tan \left (c\right )}{\tan \left (d x\right ) \tan \left (c\right ) - 1}\right ) \tan \left (d x\right )^{3} \tan \left (c\right )^{3} - 36 \, d x \tan \left (d x\right )^{2} \tan \left (c\right )^{2} + 9 \, \pi \mathrm {sgn}\left (2 \, \tan \left (d x\right )^{2} \tan \left (c\right ) + 2 \, \tan \left (d x\right ) \tan \left (c\right )^{2} - 2 \, \tan \left (d x\right ) - 2 \, \tan \left (c\right )\right ) \tan \left (d x\right )^{2} \tan \left (c\right )^{2} + 9 \, \pi \tan \left (d x\right )^{2} \tan \left (c\right )^{2} - 18 \, \arctan \left (\frac {\tan \left (d x\right ) \tan \left (c\right ) - 1}{\tan \left (d x\right ) + \tan \left (c\right )}\right ) \tan \left (d x\right )^{2} \tan \left (c\right )^{2} - 18 \, \arctan \left (\frac {\tan \left (d x\right ) + \tan \left (c\right )}{\tan \left (d x\right ) \tan \left (c\right ) - 1}\right ) \tan \left (d x\right )^{2} \tan \left (c\right )^{2} + 12 \, \tan \left (d x\right )^{3} \tan \left (c\right )^{2} + 12 \, \tan \left (d x\right )^{2} \tan \left (c\right )^{3} + 36 \, d x \tan \left (d x\right ) \tan \left (c\right ) - 9 \, \pi \mathrm {sgn}\left (2 \, \tan \left (d x\right )^{2} \tan \left (c\right ) + 2 \, \tan \left (d x\right ) \tan \left (c\right )^{2} - 2 \, \tan \left (d x\right ) - 2 \, \tan \left (c\right )\right ) \tan \left (d x\right ) \tan \left (c\right ) - 4 \, \tan \left (d x\right )^{3} - 9 \, \pi \tan \left (d x\right ) \tan \left (c\right ) + 18 \, \arctan \left (\frac {\tan \left (d x\right ) \tan \left (c\right ) - 1}{\tan \left (d x\right ) + \tan \left (c\right )}\right ) \tan \left (d x\right ) \tan \left (c\right ) + 18 \, \arctan \left (\frac {\tan \left (d x\right ) + \tan \left (c\right )}{\tan \left (d x\right ) \tan \left (c\right ) - 1}\right ) \tan \left (d x\right ) \tan \left (c\right ) - 36 \, \tan \left (d x\right )^{2} \tan \left (c\right ) - 36 \, \tan \left (d x\right ) \tan \left (c\right )^{2} - 4 \, \tan \left (c\right )^{3} - 12 \, d x + 3 \, \pi \mathrm {sgn}\left (2 \, \tan \left (d x\right )^{2} \tan \left (c\right ) + 2 \, \tan \left (d x\right ) \tan \left (c\right )^{2} - 2 \, \tan \left (d x\right ) - 2 \, \tan \left (c\right )\right ) - 6 \, \arctan \left (\frac {\tan \left (d x\right ) \tan \left (c\right ) - 1}{\tan \left (d x\right ) + \tan \left (c\right )}\right ) - 6 \, \arctan \left (\frac {\tan \left (d x\right ) + \tan \left (c\right )}{\tan \left (d x\right ) \tan \left (c\right ) - 1}\right ) + 12 \, \tan \left (d x\right ) + 12 \, \tan \left (c\right )}{12 \, {\left (d \tan \left (d x\right )^{3} \tan \left (c\right )^{3} - 3 \, d \tan \left (d x\right )^{2} \tan \left (c\right )^{2} + 3 \, d \tan \left (d x\right ) \tan \left (c\right ) - d\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)^4,x, algorithm="giac")

[Out]

1/12*(3*pi + 12*d*x*tan(d*x)^3*tan(c)^3 - 3*pi*sgn(2*tan(d*x)^2*tan(c) + 2*tan(d*x)*tan(c)^2 - 2*tan(d*x) - 2*
tan(c))*tan(d*x)^3*tan(c)^3 - 3*pi*tan(d*x)^3*tan(c)^3 + 6*arctan((tan(d*x)*tan(c) - 1)/(tan(d*x) + tan(c)))*t
an(d*x)^3*tan(c)^3 + 6*arctan((tan(d*x) + tan(c))/(tan(d*x)*tan(c) - 1))*tan(d*x)^3*tan(c)^3 - 36*d*x*tan(d*x)
^2*tan(c)^2 + 9*pi*sgn(2*tan(d*x)^2*tan(c) + 2*tan(d*x)*tan(c)^2 - 2*tan(d*x) - 2*tan(c))*tan(d*x)^2*tan(c)^2
+ 9*pi*tan(d*x)^2*tan(c)^2 - 18*arctan((tan(d*x)*tan(c) - 1)/(tan(d*x) + tan(c)))*tan(d*x)^2*tan(c)^2 - 18*arc
tan((tan(d*x) + tan(c))/(tan(d*x)*tan(c) - 1))*tan(d*x)^2*tan(c)^2 + 12*tan(d*x)^3*tan(c)^2 + 12*tan(d*x)^2*ta
n(c)^3 + 36*d*x*tan(d*x)*tan(c) - 9*pi*sgn(2*tan(d*x)^2*tan(c) + 2*tan(d*x)*tan(c)^2 - 2*tan(d*x) - 2*tan(c))*
tan(d*x)*tan(c) - 4*tan(d*x)^3 - 9*pi*tan(d*x)*tan(c) + 18*arctan((tan(d*x)*tan(c) - 1)/(tan(d*x) + tan(c)))*t
an(d*x)*tan(c) + 18*arctan((tan(d*x) + tan(c))/(tan(d*x)*tan(c) - 1))*tan(d*x)*tan(c) - 36*tan(d*x)^2*tan(c) -
 36*tan(d*x)*tan(c)^2 - 4*tan(c)^3 - 12*d*x + 3*pi*sgn(2*tan(d*x)^2*tan(c) + 2*tan(d*x)*tan(c)^2 - 2*tan(d*x)
- 2*tan(c)) - 6*arctan((tan(d*x)*tan(c) - 1)/(tan(d*x) + tan(c))) - 6*arctan((tan(d*x) + tan(c))/(tan(d*x)*tan
(c) - 1)) + 12*tan(d*x) + 12*tan(c))/(d*tan(d*x)^3*tan(c)^3 - 3*d*tan(d*x)^2*tan(c)^2 + 3*d*tan(d*x)*tan(c) -
d)

________________________________________________________________________________________

Mupad [B]
time = 2.50, size = 24, normalized size = 0.86 \begin {gather*} x-\frac {\mathrm {tan}\left (c+d\,x\right )-\frac {{\mathrm {tan}\left (c+d\,x\right )}^3}{3}}{d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(c + d*x)^4,x)

[Out]

x - (tan(c + d*x) - tan(c + d*x)^3/3)/d

________________________________________________________________________________________